<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>创建一个将华氏温度转换为摄氏温度的函数</title>
</head>
<body>
<script>
    function convertToCentigrade(degreesFahrenheit) {
        return 5/9*(degreesFahrenheit-32);
    }

    var degreesFahrenheitCollection = [212, 32, -459.15];
    var degreesCentigradeCollection = [];
    var loopCounter;
    for (loopCounter = 0; loopCounter <= 2; loopCounter++) {
        degreesCentigradeCollection[loopCounter] = convertToCentigrade(degreesFahrenheitCollection[loopCounter]);
    }
    for (loopCounter = 2; loopCounter >= 0; loopCounter--) {
        document.write('Value ' + loopCounter + ' was ' + degreesFahrenheitCollection[loopCounter] + ' degrees Fahrenheit');
        document.write(' which is ' + degreesCentigradeCollection[loopCounter] + ' degrees centigrade<br/>');
    }
</script>
</body>
</html>